package com.yt.order.provider.service.impl;

import com.yt.core.dao.filter.DynamicSQLFilterImpl;
import com.yt.core.dao.filter.QueryFilter;
import com.yt.core.service.GenericServiceImpl;
import com.yt.order.api.interfaces.GroupOrderProductService;
import com.yt.order.api.model.GroupOrderProduct;
import com.yt.order.provider.dao.GroupOrderProductDao;

import java.util.List;

/**
 * Created by liujunshi on 15-12-30.
 */
public class GroupOrderProductServiceImpl extends GenericServiceImpl<GroupOrderProduct, Long> implements GroupOrderProductService {
	private GroupOrderProductDao dao;

	public GroupOrderProductServiceImpl() {
	}

	public GroupOrderProductServiceImpl(GroupOrderProductDao dao) {
		super(dao);
		this.dao = dao;
	}

	public List<GroupOrderProduct> getByGroupOrderId(Long groupOrderId){
		QueryFilter filter = new DynamicSQLFilterImpl();
		filter.addFilter("Q_idGroupOrder_L_EQ", groupOrderId + "");
		filter.setPagingBean(null);
		List<GroupOrderProduct> list = this.dao.find(filter);
		return list;
	}
}
